home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Utilities Experience
/
The Utilities Experience - Volume 1.iso
/
software
/
comms
/
mosiac
/
mosaic_1.2_as225r2
/
contrib
/
mshunt
/
mosaic_shunt_nocomments.rexx
next >
Wrap
OS/2 REXX Batch file
|
1978-06-29
|
2KB
|
83 lines
/*Shunt for Amiga Mosaic, (c) 1994 Aaron Weiss*/
savemode=2
savedrawer='temp:pix'
jpegviewer='graphics:pfastjpeg %s'
gifviewer='graphics:vt/vt screenmode="super72:super-high res laced" %s'
iffviewer='graphics:vt/vt screenmode="super72:super-high res laced" %s'
animviewer='graphics:vt/vt screenmode="super72:super-high res laced" %s'
playiff='sound:oplay %s'
playau='sound:oplay %s'
Infile=ARG(1)
FileName=Infile
filehead=''
if open(.IFile, FileName, 'R') then do
filehead = filehead || (READCH(.IFile,40))
close (FileName)
end
SELECT
When INDEX(filehead,"GIF") > 0 then viewer=gifviewer
When INDEX(filehead,"JFIF") > 0 then viewer=jpegviewer
When INDEX(filehead,"ILBM") > 0 then viewer=iffviewer
When INDEX(filehead,"ANIM") > 0 then viewer=animviewer
When INDEX(filehead,"8SVX") > 0 then viewer=playiff
When INDEX(filehead,"snd") > 0 then viewer=playau
OTHERWISE viewer='none'
END
filepos=1
DO UNTIL filepos=0
filepos=INDEX(viewer,"%s")
If filepos>0 Then
DO
cmd1=LEFT(viewer,(filepos-1))
cmd2=RIGHT(viewer,LENGTH(viewer)-(filepos+1))
viewer=cmd1||Infile||cmd2
END
END
ADDRESS command
conwindow=">CON:0/0/320/100/Mosaic Shunt Message/Close"
CALL OPEN out, "t:rexx.tmp",write
CALL WRITELN out, viewer
CALL CLOSE out
if viewer~='none' Then 'execute' "t:rexx.tmp"
Else 'echo "Could not identify file type!" >con:0/100/255/20/Shunt_Message/CLOSE/WAIT'
If savemode>1 Then
DO
SaveFile=Infile
Mark=LASTPOS("/",SaveFile)
If Mark==0 Then
Mark=LASTPOS(":",SaveFile)
If Mark>0 Then
SaveFile=Right(SaveFile,LENGTH(SaveFile)-Mark)
If savemode=2 Then
DO
'requestfile DRAWER' savedrawer 'FILE' SaveFile 'TITLE "Save This Baby Where?" > t:savefile'
If rc~=0 Then DO
'echo "Save cancelled" >con:0/100/250/20/Shunt_Message/CLOSE/WAIT'
exit
END
ELSE DO
FileName='t:savefile'
SaveFile=''
if open(IFile, FileName, 'R') then do
do until eof(IFile)
SaveFile = SaveFile || (READLN(IFile))
end
end
END
END
ELSE SaveFile=savedrawer ||'/'||SaveFile
'copy ' Infile Savefile
END
exit